test(otlp): Refactor OTLP end-to-end testing helpers - #8973
test(otlp): Refactor OTLP end-to-end testing helpers#8973zacharycmontoya wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8973) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (73ms) : 68, 77
master - mean (72ms) : 69, 75
section Bailout
This PR (8973) - mean (75ms) : 73, 77
master - mean (81ms) : 73, 89
section CallTarget+Inlining+NGEN
This PR (8973) - mean (1,097ms) : 1042, 1153
master - mean (1,096ms) : 1052, 1141
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (113ms) : 106, 120
master - mean (115ms) : 108, 121
section Bailout
This PR (8973) - mean (111ms) : 109, 113
master - mean (115ms) : 108, 122
section CallTarget+Inlining+NGEN
This PR (8973) - mean (786ms) : 762, 811
master - mean (785ms) : 763, 807
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (102ms) : 95, 108
master - mean (103ms) : 97, 109
section Bailout
This PR (8973) - mean (102ms) : 96, 108
master - mean (99ms) : 96, 103
section CallTarget+Inlining+NGEN
This PR (8973) - mean (943ms) : 904, 981
master - mean (950ms) : 901, 999
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (96ms) : 94, 99
master - mean (98ms) : 92, 105
section Bailout
This PR (8973) - mean (101ms) : 95, 107
master - mean (102ms) : 96, 108
section CallTarget+Inlining+NGEN
This PR (8973) - mean (821ms) : 781, 861
master - mean (822ms) : 782, 862
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (207ms) : 201, 212
master - mean (211ms) : 205, 217
section Bailout
This PR (8973) - mean (211ms) : 206, 216
master - mean (215ms) : 211, 219
section CallTarget+Inlining+NGEN
This PR (8973) - mean (1,243ms) : 1192, 1293
master - mean (1,268ms) : 1214, 1321
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (294ms) : 287, 301
master - mean (303ms) : 294, 312
section Bailout
This PR (8973) - mean (295ms) : 290, 301
master - mean (305ms) : 295, 315
section CallTarget+Inlining+NGEN
This PR (8973) - mean (987ms) : 965, 1008
master - mean (1,009ms) : 984, 1035
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (288ms) : 282, 294
master - mean (298ms) : 291, 305
section Bailout
This PR (8973) - mean (287ms) : 282, 292
master - mean (297ms) : 291, 303
section CallTarget+Inlining+NGEN
This PR (8973) - mean (1,186ms) : 1145, 1226
master - mean (1,200ms) : 1160, 1239
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (288ms) : 281, 296
master - mean (300ms) : 294, 306
section Bailout
This PR (8973) - mean (290ms) : 284, 295
master - mean (301ms) : 293, 308
section CallTarget+Inlining+NGEN
This PR (8973) - mean (1,059ms) : 1011, 1108
master - mean (1,094ms) : 989, 1199
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
andrewlock
left a comment
There was a problem hiding this comment.
Started reviewing the helper before I twigged that it was a direct copy (the description does say that, it's on me 🤦♂️) so otherwise just assumed it's ok.
Strange so many tests are failing though? 🤔
| // by the test agent with snake_case field names and string-form enum values) to the | ||
| // OTLP http/json shape (camelCase field names, integer enum values). When a new OTLP | ||
| // field or enum reaches the serializer, add the mapping here. | ||
| private static readonly (string From, string To)[] ProtobufToJsonFieldNameMappings = |
There was a problem hiding this comment.
Isn't this same mapping encoded in OtlpFieldNames? Do we need both?
| ("\"code\": \"STATUS_CODE_ERROR\"", "\"code\": 2"), | ||
| }; | ||
|
|
||
| private static readonly Regex TraceIdRegex = new(@"^([a-fA-F0-9]{32})$"); |
There was a problem hiding this comment.
Do we need to handle 64bit TraceIDs, or no, because this is Otel only?
Summary of changes
Test-only changes to consolidate the submission/retrieval/scrubbing of OTLP data in the end-to-end snapshot test cases in
tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/OpenTelemetrySdkTests.cs.Reason for change
Isolating OTLP handling will allow us to more easily author OTLP end-to-end snapshot test cases in other sample applications.
Implementation details
Ports helpers methods from
tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/OpenTelemetrySdkTests.cstotracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/Helpers/OtlpSnapshotHelper.csThis also updates the
Datadog.Trace.OSXsolution filter to exclude a test application with the legacy style csproj file to reduce build errors in Rider on macOS.Test coverage
The existing
OpenTelemetrySdkTestsconfirm that the tests pass as before.Other details
Note: This is built on top of the existing OpenTelemetry branches because it was isolated into its own set of commits while working on the comprehensive set of changes.